//package cn.itcast.common.schedulerTask;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
//import java.util.concurrent.Executor;
//import java.util.concurrent.ThreadPoolExecutor;
///**
// * @Author:
// * @Date: Created in 2021/09/10 09:40
// * @Description： 线程池配置
// */
//@Configuration // 表明该类是一个配置类
//@EnableAsync // 启用 Spring 的异步方法执行功能
//public class AsyncConfig {
//    @Value("${myProps.corePoolSize}")
//    private int corePoolSize;
//    @Value("${myProps.maxPoolSize}")
//    private int maxPoolSize;
//    @Value("${myProps.queueCapacity}")
//    private int queueCapacity;
//    @Bean("asyncExecutor") //定义线程池bean和名字
//    public Executor taskExecutor() {
//        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
//        executor.setCorePoolSize(corePoolSize);
//        executor.setMaxPoolSize(maxPoolSize);
//        executor.setQueueCapacity(queueCapacity);
//        executor.initialize();
//        return executor;
//    }
//}
